import 'package:get/get.dart';
import 'views/pages/home_page.dart';
import 'views/pages/record_page.dart';
import 'views/pages/history_page.dart';
import 'views/pages/analysis_page.dart';
import 'views/pages/settings_page.dart';
import 'views/pages/record_detail_page.dart';
import 'controllers/emotion_controller.dart';
import 'controllers/analytics_controller.dart';
import 'controllers/history_controller.dart';
import 'controllers/settings_controller.dart';
import 'controllers/record_controller.dart';
import 'controllers/record_detail_controller.dart';

/// 应用路由配置类
/// Application route configuration class
class AppPages {
  /// 路由列表
  /// Route list
  static final routes = [
    // 首页路由
    // Home page route
    GetPage(
      name: '/home',
      page: () => const HomePage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<EmotionController>(() => EmotionController());
      }),
      transition: Transition.fadeIn,
    ),
    
    // 记录页面路由
    // Record page route
    GetPage(
      name: '/record',
      page: () => const RecordPage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<RecordController>(() => RecordController());
      }),
      transition: Transition.rightToLeft,
    ),
    
    // 历史页面路由
    // History page route
    GetPage(
      name: '/history',
      page: () => const HistoryPage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<HistoryController>(() => HistoryController());
      }),
      transition: Transition.rightToLeft,
    ),
    
    // 趋势分析页面路由
    // Analytics page route
    GetPage(
      name: '/analytics',
      page: () => const AnalysisPage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<AnalyticsController>(() => AnalyticsController());
      }),
      transition: Transition.rightToLeft,
    ),
    
    // 设置页面路由
    // Settings page route
    GetPage(
      name: '/settings',
      page: () => const SettingsPage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<SettingsController>(() => SettingsController());
      }),
      transition: Transition.rightToLeft,
    ),
    
    // 记录详情页面路由
    // Record detail page route
    GetPage(
      name: '/record-detail',
      page: () => const RecordDetailPage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<RecordDetailController>(() => RecordDetailController());
      }),
      transition: Transition.rightToLeft,
    ),
  ];
}

/// 路由名称常量
/// Route name constants
class Routes {
  static const String home = '/home';
  static const String record = '/record';
  static const String history = '/history';
  static const String analytics = '/analytics';
  static const String settings = '/settings';
  static const String recordDetail = '/record-detail';
}